//
//  CCEffectDFInnerGlow.h
//  cocos2d-ios
//
//  Created by Oleg Osin on 9/11/14.
//
//

#import "CCEffect.h"

#if CC_EFFECTS_EXPERIMENTAL

/**
 CCEffectDFInnerGlow create an inner glow on any sprite (combined with a distance field).
 @note This class is currently considered experimental. Set the `CC_EFFECTS_EXPERIMENTAL` macro to 1 in ccConfig.h if you want to use this class.
 */
@interface CCEffectDFInnerGlow : CCEffect

/// -----------------------------------------------------------------------
/// @name Creating a Glow Effect
/// -----------------------------------------------------------------------

/**
*  Initializes a CCEffectDFInnerGlow object with the supplied parameters.
*
*  @param glowColor Color of the glow, a [CCColor blackColor] will result in an opaque black glow.
*  @param fillColor Color of the fillColor, a [CCColor blackColor] will result in an opaque black fillColor.
*  @param glowWidth pixel width of the glow.
*  @param fieldScale defined by the distance field generation proccess, for example a distance field that
*  was generated with a 4096/4096 input and output a 128/128 texture would have a fieldScale of 32 (
*  input size / output size). Note: this parameter could be automatically calculated if we assume that all
*  distance fields are generated from a 4096 input.
*  @param distanceField Distance field texture.
*
*  @return The CCEffectDFInnerGlow object.
*  @since v3.3 and later
*  @see CCColor
*  @see CCTexture
*/
+(instancetype)effectWithGlowColor:(CCColor*)glowColor fillColor:(CCColor*)fillColor glowWidth:(int)glowWidth fieldScale:(float)fieldScale distanceField:(CCTexture*)distanceField;

/**
 *  Initializes a CCEffectDFInnerGlow.
 *
 *  @return The CCEffectDFInnerGlow object.
 *  @since v3.3 and later
 */
-(id)init;

/**
 *  Initializes a CCEffectDFInnerGlow object with the supplied parameters.
 *
 *  @param glowColor Color of the glow, a [CCColor blackColor] will result in an opaque black glow.
 *  @param fillColor Color of the fillColor, a [CCColor blackColor] will result in an opaque black fillColor.
 *  @param glowWidth pixel width of the glow.
 *  @param fieldScale defined by the distance field generation process, for example a distance field that
 *  was generated with a 4096/4096 input and output a 128/128 texture would have a fieldScale of 32 (
 *  input size / output size). Note: this parameter could be automatically calculated if we assume that all
 *  distance fields are generated from a 4096 input.
 *  @param distanceField Distance field texture.
 *
 *  @return The CCEffectDFInnerGlow object.
 *  @since v3.3 and later
 *  @see CCColor
 *  @see CCTexture
 */
-(id)initWithGlowColor:(CCColor*)glowColor fillColor:(CCColor*)fillColor glowWidth:(int)glowWidth fieldScale:(float)fieldScale distanceField:(CCTexture*)distanceField;

/// -----------------------------------------------------------------------
/// @name Accessing Effect Attributes
/// -----------------------------------------------------------------------

/** Color of the sprite (pass a fillColor with with alpha value of 0.0 to see the actual sprite)
 @since v3.3 and later
 @see CCColor
 */
@property (nonatomic, strong) CCColor* fillColor;

/** Color of glow
 @since v3.3 and later
 @see CCColor
 */
@property (nonatomic, strong) CCColor* glowColor;

/** Outline width pixel width of the glow
 @since v3.3 and later
 */
@property (nonatomic) int glowWidth;

// Distance Field, generated by SDFGen (https://github.com/osinoleg/SDFGen)
@property (nonatomic, strong) CCTexture* distanceField;

@end

#endif

